/*********************************************************************************
Organization 					: 				Georgia Institute of Technology
  
Institute 						:				Cognitive Computing Group(CCL)
 
Authors							: 				Santiago Ontanon
 												
Class							:				OilCondition
 
Function						: 				Provides a class for holding 
												the oil condition class
****************************************************************************/
package planninglanguage.softconditions;

import mre.MRE;
import base.WargusGameState;


public class AbsoluteOilSoftCondition extends SoftCondition {
	int m_minOil;
	public AbsoluteOilSoftCondition(int a_minOil)
	{
		m_minOil = a_minOil;
	}
	
	public String toString(int tabs) {
	  String n = super.toString(tabs);
	  n = n + "Min Oil is :" + m_minOil;
	  return n;
	}	
	public float test(WargusGameState a_gameState)
	{
		if (a_gameState.getPlayer().getOil()-MRE.allocated_oil >= m_minOil) return 1.0f;
																	   else return (a_gameState.getPlayer().getOil()-MRE.allocated_oil)/((float)m_minOil);			
	}
	
}
